The field is only valid for the term directly preceeding the colon. The following query will only find "Some" in the title field and will search for Title in the default fields.
|
THANK YOU JENS! Superb, I've been after such a list ever since I realised that Lucene (sp?) allowed this sort of thing. Yay! Mind if I rob a copy for our own user guide? We've got a page dedicated to advanced searching 

Posted by gfraser at Feb 09, 2006 19:17
|
|
This is only a simple overview over the fields used in the index. We will need to filter and document the important content fields to make this document more useful.

Posted by jens@atlassian.com at Feb 09, 2006 19:19
|
|
I noticed that there were 2 "recipients" fields in the Mail properties?

Posted by gfraser at Feb 09, 2006 19:22
|
|
Guy,
You're more than welcome to grab a copy. We'll have to work on documenting each single field and filter the less useful ones. For example the handle and modified fields are not very useful for a field search. Would be great if you could let us know when you make any enhancements to the docs.
Cheers,
Jens

Posted by jens@atlassian.com at Feb 09, 2006 19:25
|
|
I've noticed that too. Will have to check that 

Posted by jens@atlassian.com at Feb 09, 2006 19:26
|
|
Adding a footnote here for what the "default" contentBody (and title) tokenizer setup would be handy. 

Posted by benny.yih@ieee.org at Mar 10, 2006 15:40
|
|
Let's say that lots of my pages each have lots of attachments, potentially big ones.
Is it possible to specify a search that searches only the attachments of the currently-displayed page?
And, also handy would be ... a way to search the targets of links in the current page.
TIA.

Posted by fbaube at May 09, 2006 06:36
|
|
Thanks, this has come in handy.
BTW, do you know how to index particular fields that aren't currently indexed, e.g. creatorName and lastModifierName?
I've found a tool (LUKE) to update indexes, though Confluence seems to have it's own determination of what's indexed. Is this configurable somewhere?
Thanks,
Jim

Posted by jclark42796 at Oct 17, 2006 08:37
|
|
How do you search date fields? e.g. created. The index shows the value "0etd7sv5q". How would you find out which pages were created 10/17/2006? I tried variations of the date format, e.g. created:"2006-10-16"
Thanks,
Jim

Posted by jclark42796 at Oct 17, 2006 08:59
|
|
I have the same problem as Jim. It seems that Confluence ignores or at least doesn't understand search queries like "lastModified:yesterday" or "lastModified:2d" (= two days ago) although I found these expressions in the documentation (don't remember the link).
TIA,
Aleks

Posted by spaddo at Oct 29, 2006 11:37
|
|
Did you get this figured out? I am trying to search for everything that I have created or has my username attached to. (Basically a "show my posts" like in a forum, so i can see what i have posted or commented on etc.)

Posted by jguthrie at Nov 03, 2006 19:08
|
|
I did figure it out. You'll need to create an extractor plugin Extractor plugins allow you to insert fields in to the index. You'll need to be familiar with Java and building Java software using Ant.
I don't have the code here at home but if you have access to the Confluence source code you can look at the class
com.atlassian.confluence.search.lucene.extractor.ContentEntityMetadataExtractor
My extractor looks something like:
import bucket.search.Searchable;
import bucket.search.lucene.Extractor;
import com.atlassian.confluence.core.ConfluenceEntityObject;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
public class MyExtractor implements Extractor
{
public void addFields(Document document, StringBuffer defaultSearchableText, Searchable searchable)
{
if (searchable instanceof ConfluenceEntityObject)
extractCreator((ConfluenceEntityObject) searchable, document);
}
private void extractCreator(ConfluenceEntityObject ceo, Document document)
{
if (ceo.getCreatorName() != null)
document.add(new Field("author", ceo.getCreatorName(), Field.Store.YES, Field.Index.UN_TOKENIZED));
}
}
What I did was add the page "creator" to the index as "author"
if (ceo.getCreatorName() != null)
document.add(new Field("author", ceo.getCreatorName(), Field.Store.YES, Field.Index.UN_TOKENIZED));
After installing the plugin you can use the Lucene index viewer to see your documents with the "author" added to the index, at something like http://localhost:8080/confluence/admin/indexbrowser.jsp
You should then be able to search for your docs using a search query of "author:my_userid".
I may just post the packaged plugin but it may take a week or so before that happens.

Posted by jclark42796 at Nov 03, 2006 20:09
|
|
packaged plugin would be great! We haven't actually installed Confluence yet so i have some time to wait. I was just testing out a few things and being able to easily find content you have posted, commented on etc. seemed to be missing.

Posted by jguthrie at Nov 06, 2006 11:00
|
|
Shouldn't a search using this syntax: username:"jguthrie" return pages I have created, edited, or commented on etc? As it stand right now, this search doesn't return any results.

Posted by jguthrie at Nov 09, 2006 12:30
|
|
To add what I've done above in MyExtractor, I've added an alternative indexed field for creation date.
import bucket.search.Searchable;
import bucket.search.lucene.Extractor;
import com.atlassian.confluence.core.ConfluenceEntityObject;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
public class MyExtractor implements Extractor
{
public void addFields(Document document, StringBuffer defaultSearchableText, Searchable searchable)
{
if (searchable instanceof ConfluenceEntityObject)
extractCreator((ConfluenceEntityObject) searchable, document);
}
private void extractCreator(ConfluenceEntityObject ceo, Document document)
{
if(ceo.getCreationDate() != null)
{
ThreadLocalSimpleDateFormat format = new ThreadLocalSimpleDateFormat("yyyy-MM-dd");
document.add(new Field("createdDate", format.format(ceo.getCreationDate()), org.apache.lucene.document.Field.Store.YES, org.apache.lucene.document.Field.Index.UN_TOKENIZED));
}
}
Adding this format of creation date allows me do a query like:
createdDate:2006-11-09

Posted by jclark42796 at Nov 09, 2006 13:29
|
|
As noted above in "Confluence Search Fields", username is only a search field for personal information, not pages. creatorName (author) and lastModifierName (editor) are in the index but not searchable. Therefore, I had to create an extractor plugin to allow searching for editor/author see my comments above

Posted by jclark42796 at Nov 09, 2006 13:39
|
|
I'm pretty sure there is already a {contentbyuser} macro that comes with Confluence...?

Posted by gfraser at Nov 09, 2006 13:49
|
|
I could be mistaken, but I think Jeff is trying to perform a search vs. using a macro. The extractor I wrote would insert searchable fields in to the Confluence search index. I guess he could create a page that includes the macro.

Posted by jclark42796 at Nov 09, 2006 14:07
|
|
Oh ok, i understand now. I thought they are all search able and the headings were just for the type of information that can be searched....

Posted by jguthrie at Nov 09, 2006 15:09
|
|
Yes I was trying to perform a search as I was hoping for users to be able to have an easy way for them to navigate back to pages they have created, edited, commented on etc. I will have to give your extractor a go I think. Did you finish making it a packaged plugin? The way getting these things installed where i work is i need to go through a sys admin to get plugins etc installed etc... I don't have direct access to the server and file system of our Confluence install. 

Posted by jguthrie at Nov 09, 2006 15:13
|
|
I am getting an unknown macro error on this when I try to use it. Do you have a link to its use? I did a search and your comment appears to be the only place its mentioned.

Posted by jguthrie at Nov 09, 2006 16:57
|
|
I might have the macro name incorrect - I only ever used that macro once and it generated a HUGE list of results (as I'd added literally thousands of pages to our site) so didn't return to it. The big drawback of that macro (if it's still available) is that its results aren't paginated. If the macro is still part of Confluence, it should show up in the notation guide.

Posted by gfraser at Nov 09, 2006 19:38
|
|
Try this
| Content created by Anonymous |
| There are no pages at the moment. |
e.g.
| Content created by Anonymous |
| There are no pages at the moment. |

Posted by jclark42796 at Nov 09, 2006 19:44
|
|
whoops, try this 
{content-by-user:jguthrie}

Posted by jclark42796 at Nov 09, 2006 19:47
|
|
Ah, hyphens! I knew there was something like that 

Posted by gfraser at Nov 09, 2006 19:50
|
|
That is exactly what i wanted!!! Thanks a ton! 

Posted by jguthrie at Nov 10, 2006 10:49
|
|
That is exactly what i wanted!!! Thanks a ton! 

Posted by jguthrie at Nov 10, 2006 10:49
|
|
This worked for me in Confluence 2.2.8. When I try to build it under Confluence 2.3 I get the following error:
[mkdir] Created dir: /opt/confluence/confluence-2.3/plugins/bcsearch/classes
[javac] Compiling 1 source file to /opt/confluence/confluence-2.3/plugins/bcsearch/classes
[javac] /opt/confluence/confluence-2.3/plugins/bcsearch/src/java/brazos/confluence/plugins/search/PageAuthorExtractor.java:10: cannot find symbol
[javac] symbol : class Searchable
[javac] location: package bucket.search
[javac] import bucket.search.Searchable;
[javac] ^
[javac] /opt/confluence/confluence-2.3/plugins/bcsearch/src/java/brazos/confluence/plugins/search/PageAuthorExtractor.java:11: package bucket.search.lucene does not exist
[javac] import bucket.search.lucene.Extractor;
[javac] ^
[javac] /opt/confluence/confluence-2.3/plugins/bcsearch/src/java/brazos/confluence/plugins/search/PageAuthorExtractor.java:16: cannot find symbol
[javac] symbol: class Extractor
[javac] public class PageAuthorExtractor implements Extractor
[javac] ^
[javac] /opt/confluence/confluence-2.3/plugins/bcsearch/src/java/brazos/confluence/plugins/search/PageAuthorExtractor.java:18: cannot find symbol
[javac] symbol : class Searchable
[javac] location: class brazos.confluence.plugins.search.PageAuthorExtractor
[javac] public void addFields(Document document, StringBuffer defaultSearchableText, Searchable searchable)
[javac] ^
[javac] 4 errors

Posted by sudhakar@co.brazos.tx.us at Jan 09, 2007 08:24
|